@extends('user.base')
@section('content-header','Edit Case')
@section('content-body')
<!-- Main content -->
<section class="content">
	<div class="container-fluid">
		<div>
			<a class="btn btn-success" href="{{ URL('patient/patient/'.$case->patient_id.'/case/'.$case->id.'/print')}}">Print Preview</a>
		</div>
		<hr />
		<div id="display" style="padding-bottom:20px">
			<p>
				<h4>
					<em>OS:</em>
				</h4>
			</p>
			@foreach($imgs_os as $img)
			<a href="{{URL('patient/patient/'.$case->patient_id.'/case/'.$case->id.'/picture/'.$img->id)}}">
				<img style="height: 160px; width: 260px; padding-right: 10px;" src="{{ asset("$img->pic_url")}}" alt="img"/>
			</a>
			@endforeach
			<hr class="divider">
			<p>
				<h4>
					<em>OD:</em>
				</h4>
			</p>
			@foreach($imgs_od as $img)
			<a href="{{URL('patient/patient/'.$case->patient_id.'/case/'.$case->id.'/picture/'.$img->id)}}">
				<img style="height: 160px; width: 260px; padding-right: 10px;" src="{{ asset("$img->pic_url")}}" alt="img"/>
			</a>
			@endforeach
			<hr class="divider">
		</div>
		<!--Patient Info-->
		<div id="patient_info">
			<form action="{{ URL('case/info/'.$case->id)}}" method="post" accept-charset="utf-8">
				<input type="hidden" name="_method" value="PUT">
				<input type="hidden" name="_token" value="{{ csrf_token() }}">
				<input type="hidden" name="_patient_id" value="{{ $case->patient_id }}">
				<div class="form-group col-md-3">
					<label>First Name:</label>
					<input class="form-control" type="text" required="required" name="firstname" value="{{ $case->first_name }}" placeholder="Enter patient firstname here.">
				</div>
				<div class="form-group col-md-3">
					<label>Last Name:</label>
					<input class="form-control" type="text" required="required" name="lastname" value="{{ $case->last_name }}" placeholder="Enter patient family name here.">
				</div>
				<div class="form-group col-md-3">
					<label>OS:</label>
					<input class="form-control" type="number" min="0.0" max="5.1" name="eyeSightLeft" value="{{ $case->eyesight_left }}" placeholder="0.0" step="0.1">
				</div>
				<div class="form-group col-md-3">
					<label>OD:</label>
					<input class="form-control" type="number" min="0.0" max="5.1" name="eyeSightRight" value="{{ $case->eyesight_right }}" placeholder="0.0" step="0.1">
				</div>
				<div class="form-group col-md-12">
					<label>Case Description:</label>
					<br>
					<textarea class="form-control" name="caseDescription" value="" placeholder="Enter brief case description here." rows="5" cols="50">{{ $case->description }}</textarea>					

				</div>
				<div class="form-group col-md-12">
					<button type="submit" name="createCase" class="form-control btn btn-success btn-large">
						Update
					</button>
				</div>
				<div class="form-group col-md-12">
					<a href="{{ URL('patient/info/'.$case->patient_id.'/edit')}}" class="form-control btn btn-danger btn-large">
						Cancel
					</a>
				</div>
			</form>
		</div><!--Patient Info-->
	</div>
	</div>
	<!--Patient Case Info section-->
	<div class="container col-md-3">
	</div>
</section><!-- /.Left col -->
@endsection
@section('js')

@endsection
